package main

import (
	"fmt"
	"net"
	"net/http"
	"net/rpc"
	serv "tacitus/library/services"
	"tacitus/modules/user"
)

func main() {
	l, err := net.Listen("tcp", ":8401")
	if err != nil {
		fmt.Println(err)
		return
	}

	if err := rpc.RegisterName("User", new(user.Service)); err != nil {
		fmt.Println(err)
		return
	}
	serv.Register("tcp", "localhost:8401", "User")

	rpc.HandleHTTP()
	if err = http.Serve(l, nil); err != nil {
		fmt.Println(err)
		return
	}
}
